﻿// Control10Dlg.cpp: 实现文件
//

#include "pch.h"
#include "ProjectAA.h"
#include "Control10Dlg.h"
#include "afxdialogex.h"


// CControl10Dlg 对话框

IMPLEMENT_DYNAMIC(CControl10Dlg, CDialogEx)

CControl10Dlg::CControl10Dlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_CONTROL_10, pParent)
{

}

CControl10Dlg::~CControl10Dlg()
{
}

void CControl10Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CControl10Dlg, CDialogEx)
	ON_BN_CLICKED(IDC_BUTTON26, &CControl10Dlg::OnBnClickedButton26)
	ON_BN_CLICKED(IDC_BUTTON1, &CControl10Dlg::OnBnClickedButton1)
	ON_BN_CLICKED(IDC_BUTTON2, &CControl10Dlg::OnBnClickedButton2)
	ON_BN_CLICKED(IDC_BUTTON3, &CControl10Dlg::OnBnClickedButton3)
	ON_BN_CLICKED(IDC_BUTTON4, &CControl10Dlg::OnBnClickedButton4)
	ON_BN_CLICKED(IDC_BUTTON10, &CControl10Dlg::OnBnClickedButton10)
	ON_BN_CLICKED(IDC_BUTTON5, &CControl10Dlg::OnBnClickedButton5)
	ON_BN_CLICKED(IDC_BUTTON6, &CControl10Dlg::OnBnClickedButton6)
	ON_BN_CLICKED(IDC_BUTTON27, &CControl10Dlg::OnBnClickedButton27)
	ON_BN_CLICKED(IDC_BUTTON28, &CControl10Dlg::OnBnClickedButton28)
	ON_BN_CLICKED(IDC_BUTTON29, &CControl10Dlg::OnBnClickedButton29)
	ON_BN_CLICKED(IDC_BUTTON30, &CControl10Dlg::OnBnClickedButton30)
END_MESSAGE_MAP()


// CControl10Dlg 消息处理程序


BOOL CControl10Dlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();


	return TRUE; 
}


void CControl10Dlg::OnCancel()
{

	CDialogEx::OnCancel();
}


void CControl10Dlg::OnBnClickedButton26()
{
	if (gSystemMgr.Y45 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(45, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(45, OFF);
	}
}


void CControl10Dlg::OnBnClickedButton1()
{
	if (gSystemMgr.Y02 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(2, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(2, OFF);
	}
}


void CControl10Dlg::OnBnClickedButton2()
{
	gSystemMgr.m_cIo.SetOutputIo(0, ON);
	gSystemMgr.m_cIo.SetOutputIo(1, OFF);
}


void CControl10Dlg::OnBnClickedButton3()
{
	gSystemMgr.m_cIo.SetOutputIo(1, ON);
	gSystemMgr.m_cIo.SetOutputIo(0, OFF);
}


void CControl10Dlg::OnBnClickedButton4()
{
	if (gSystemMgr.Y03 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(3, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(3, OFF);
	}
}


void CControl10Dlg::OnBnClickedButton10()
{
	if (gSystemMgr.Y04 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(4, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(4, OFF);
	}
}


void CControl10Dlg::OnBnClickedButton5()
{
	gSystemMgr.m_cIo.SetOutputIo(5, ON);
	gSystemMgr.m_cIo.SetOutputIo(6, OFF);
}


void CControl10Dlg::OnBnClickedButton6()
{
	gSystemMgr.m_cIo.SetOutputIo(6, ON);
	gSystemMgr.m_cIo.SetOutputIo(5, OFF);
}


void CControl10Dlg::OnBnClickedButton27()
{
	if (gSystemMgr.Y59 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(59, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(59, OFF);
	}
}


void CControl10Dlg::OnBnClickedButton28()
{
	if (gSystemMgr.Y58 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(58, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(58, OFF);
	}
}


void CControl10Dlg::OnBnClickedButton29()
{
	gSystemMgr.m_cIo.SetOutputIo(14, ON);
	gSystemMgr.m_cIo.SetOutputIo(15, OFF);
}


void CControl10Dlg::OnBnClickedButton30()
{
	gSystemMgr.m_cIo.SetOutputIo(15, ON);
	gSystemMgr.m_cIo.SetOutputIo(14, OFF);
}
